<?php
/*
 * Copyright (c) 2017-2025 Tencent. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
namespace TencentCloud\Tbaas\V20180416\Models;
use TencentCloud\Common\AbstractModel;

/**
 * DescribeFabricBlock response structure.
 *
 * @method integer getBlockHeight() Obtain Block height.
 * @method void setBlockHeight(integer $BlockHeight) Set Block height.
 * @method string getBlockHash() Obtain Block Hash.
 * @method void setBlockHash(string $BlockHash) Set Block Hash.
 * @method string getPreBlockHash() Obtain Pre-Block Hash.
 * @method void setPreBlockHash(string $PreBlockHash) Set Pre-Block Hash.
 * @method integer getTxCount() Obtain The number of transactions in a block.
 * @method void setTxCount(integer $TxCount) Set The number of transactions in a block.
 * @method array getTransactionList() Obtain Transaction list in the block.
 * @method void setTransactionList(array $TransactionList) Set Transaction list in the block.
 * @method string getCreateTimestamp() Obtain Creation Timestamp
 * @method void setCreateTimestamp(string $CreateTimestamp) Set Creation Timestamp
 * @method string getProposerOrg() Obtain Proposal organization.
 * @method void setProposerOrg(string $ProposerOrg) Set Proposal organization.
 * @method string getRequestId() Obtain The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
 * @method void setRequestId(string $RequestId) Set The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
 */
class DescribeFabricBlockResponse extends AbstractModel
{
    /**
     * @var integer Block height.
     */
    public $BlockHeight;

    /**
     * @var string Block Hash.
     */
    public $BlockHash;

    /**
     * @var string Pre-Block Hash.
     */
    public $PreBlockHash;

    /**
     * @var integer The number of transactions in a block.
     */
    public $TxCount;

    /**
     * @var array Transaction list in the block.
     */
    public $TransactionList;

    /**
     * @var string Creation Timestamp
     */
    public $CreateTimestamp;

    /**
     * @var string Proposal organization.
     */
    public $ProposerOrg;

    /**
     * @var string The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
     */
    public $RequestId;

    /**
     * @param integer $BlockHeight Block height.
     * @param string $BlockHash Block Hash.
     * @param string $PreBlockHash Pre-Block Hash.
     * @param integer $TxCount The number of transactions in a block.
     * @param array $TransactionList Transaction list in the block.
     * @param string $CreateTimestamp Creation Timestamp
     * @param string $ProposerOrg Proposal organization.
     * @param string $RequestId The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
     */
    function __construct()
    {

    }

    /**
     * For internal only. DO NOT USE IT.
     */
    public function deserialize($param)
    {
        if ($param === null) {
            return;
        }
        if (array_key_exists("BlockHeight",$param) and $param["BlockHeight"] !== null) {
            $this->BlockHeight = $param["BlockHeight"];
        }

        if (array_key_exists("BlockHash",$param) and $param["BlockHash"] !== null) {
            $this->BlockHash = $param["BlockHash"];
        }

        if (array_key_exists("PreBlockHash",$param) and $param["PreBlockHash"] !== null) {
            $this->PreBlockHash = $param["PreBlockHash"];
        }

        if (array_key_exists("TxCount",$param) and $param["TxCount"] !== null) {
            $this->TxCount = $param["TxCount"];
        }

        if (array_key_exists("TransactionList",$param) and $param["TransactionList"] !== null) {
            $this->TransactionList = [];
            foreach ($param["TransactionList"] as $key => $value){
                $obj = new Transaction();
                $obj->deserialize($value);
                array_push($this->TransactionList, $obj);
            }
        }

        if (array_key_exists("CreateTimestamp",$param) and $param["CreateTimestamp"] !== null) {
            $this->CreateTimestamp = $param["CreateTimestamp"];
        }

        if (array_key_exists("ProposerOrg",$param) and $param["ProposerOrg"] !== null) {
            $this->ProposerOrg = $param["ProposerOrg"];
        }

        if (array_key_exists("RequestId",$param) and $param["RequestId"] !== null) {
            $this->RequestId = $param["RequestId"];
        }
    }
}
